import request from '@/router/axios'

// 列表
export const getTemplate = (current, size, params) => {
  return request({
    url: '/api/projecttmpl/page',
    method: 'get',
    params: {
      current,
      size,
      ...params
    }
  })
}

// 详情
export const getDetail = (id) => {
  return request({
    url: '/api/projecttmpl/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 新增及修改保存
export const saveTemplate = (data) => {
  return request({
    url: '/api/projecttmpl/submit',
    method: 'post',
    data
  })
}

// 新增及修改保存
export const changeStatus = (data) => {
  return request({
    url: '/api/projecttmpl/update',
    method: 'post',
    data
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/projecttmpl/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

// 获取全部阶段任务
export const getAllTask = (params) => {
  return request({
    url: '/api/projecttmpl/getTmplDetail',
    method: 'get',
    params
  })
}

//列表不分页
export const getTemplateLists = (params) => {
  return request({
    url: '/api/projecttmpl/list',
    method: 'get',
    params
  })
}
